<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加体检批次界面</title>
    <link rel="stylesheet" href="../css/phyNewBatch.css">
    <script src="../js/jquery.js"></script>
    <script src="../js/phyNewBatch.js"></script>
</head>
<body>
<div class="phyNewBatchOper">
    <button id="createNewBatchBtn">添加批次</button>
    <label for="phyNewBatchOperSelect">批次名称</label>
    <input type="text" id="phyNewBatchOperSelect" placeholder="请输入批次名称">
    <button id="phyNewBatchOperSelectBtn">点击查询</button>
</div>

<hr/>
<!--添加体检批次界面-->
<div class="phyNewBatchAddInput">
    <div>
        <label for="phyNewBatchInputName">体检批次名称</label>
        <input type="text" class="phyNewBatchInput" id="phyNewBatchInputName" placeholder="请输入批次名称">
        <span id="judgeName"></span>
    </div>
    <div>
        <label for="phyNewBatchBeginTime">体检开始时间</label>
        <input type="date" class="phyNewBatchInput" id="phyNewBatchBeginTime" placeholder="选择开始时间">
        <span id="judgeBeginTime"></span>
    </div>
    <div>
        <label for="phyNewBatchEndTime">体检结束时间</label>
        <input type="date" class="phyNewBatchInput" id="phyNewBatchEndTime" placeholder="选择结束时间">
        <span id="judgeOverTime"></span>
    </div>
    <div id="projectNameShow" >
        <label for="tb_5">选择体检项目</label>
        <table id="tb_5" cellspacing="0" cellpadding="2" width="100%" border="1">
            <tr align="center" bgcolor="#dcdcdc">
                <td style="width:30px;"></td>
                <td>项目名称</td>
            </tr>
            <!--<tr >-->
                <!--<td style="width:80px;">-->
                    <!--<button class="projectNameShowSon" data-id="">添加</button>-->
                <!--</td>-->
                <!--<td>项目名称</td>-->
            <!--</tr>-->
        </table>
    </div>
    <div id="phyNewBatchAddInputButton">
        <button id="phyNewBatchAddInputSureBtn" type="submit">确认</button>
        <button id="phyNewBatchAddInputBackBtn" type="submit">返回</button>
    </div>
</div>

<!--显示历史记录界面-->
<div class="phyBatchInformation">
    <table id="tb_6" cellspacing="0" cellpadding="2" width="100%" border="1">
        <tr align="center" bgcolor="#dcdcdc">
            <td style="width:30px;"><input id="phyBatchInformationFather" type="checkbox"></td>
            <td>批次名称</td>
            <td>开始时间</td>
            <td>结束时间</td>
            <td>项目名称</td>
            <td>操作</td>
        </tr>
        <!--<tr>-->
            <!--<td style="width:30px;"><input class="phyBatchInformationSon" type="checkbox"></td>-->
            <!--<td>批次名称</td>-->
            <!--<td>2018/04/05</td>-->
            <!--<td>2018/04/07</td>-->
            <!--<td>项目名称</td>-->
            <!--<td>-->
                <!--<button pro-id="" data-id="" class="phyBatchInformationUpdateBtn">编辑</button>-->
                <!--<button pro-id="" data-id="" class="phyBatchInformationCancelBtn">删除</button>-->
            <!--</td>-->
        <!--</tr>-->
    </table>
</div>
<!--编辑按钮弹出框获取信息事件-->
<div class="clickUpdateGetInfo">
    <div>
        <label for="getPhytName">体检批次名称</label>
        <input type="text" class="getPhy" id="getPhytName" value="" disabled="disabled">
    </div>
    <div>
        <label for="getPhytBeginTime">体检开始时间</label>
        <input type="text" class="getPhy" id="getPhytBeginTime" value="" disabled="disabled">
    </div>
    <div>
        <label for="getPhytEndTime">体检结束时间</label>
        <input type="text" class="getPhy" id="getPhytEndTime" value="" disabled="disabled">
    </div>
    <div>
        <label for="getPhytPorjectName">体检项目名称</label>
        <input type="text" class="getPhy" id="getPhytPorjectName" value="">
    </div>
    <div>
        <button id="clickUpdateGetInfoSureBtn">确认</button>
        <button id="clickUpdateGetInfoBackBtn">返回</button>
    </div>
</div>
<div id="over"></div>
<!--表格宽度可伸缩事件-->
<script type="text/javascript">
    var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题
    var table = document.getElementById("tb_5");
    var table1 = document.getElementById("tb_6");
    for (j = 0; j < table.rows[0].cells.length; j++) {
        table.rows[0].cells[j].onmousedown = function () {
//记录单元格
            tTD = this;
            if (event.offsetX > tTD.offsetWidth - 10) {
                tTD.mouseDown = true;
                tTD.oldX = event.x;
                tTD.oldWidth = tTD.offsetWidth;
            }
//记录Table宽度
//table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement;
//tTD.tableWidth = table.offsetWidth;
        };
        table.rows[0].cells[j].onmouseup = function () {
//结束宽度调整
            if (tTD == undefined) tTD = this;
            tTD.mouseDown = false;
            tTD.style.cursor = 'default';
        };
        table.rows[0].cells[j].onmousemove = function () {
//更改鼠标样式
            if (event.offsetX > this.offsetWidth - 10)
                this.style.cursor = 'col-resize';
            else
                this.style.cursor = 'default';
//取出暂存的Table Cell
            if (tTD == undefined) tTD = this;
//调整宽度
            if (tTD.mouseDown != null && tTD.mouseDown == true) {
                tTD.style.cursor = 'default';
                if (tTD.oldWidth + (event.x - tTD.oldX) > 0)
                    tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
//调整列宽
                tTD.style.width = tTD.width;
                tTD.style.cursor = 'col-resize';
//调整该列中的每个Cell
                table = tTD;
                while (table.tagName != 'TABLE') table = table.parentElement;
                for (j = 0; j < table.rows.length; j++) {
                    table.rows[j].cells[tTD.cellIndex].width = tTD.width;
                }
//调整整个表
//table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth);
//table.style.width = table.width;
            }
        };
    }
    for (j = 0; j < table1.rows[0].cells.length; j++) {
        table1.rows[0].cells[j].onmousedown = function () {
//记录单元格
            tTD = this;
            if (event.offsetX > tTD.offsetWidth - 10) {
                tTD.mouseDown = true;
                tTD.oldX = event.x;
                tTD.oldWidth = tTD.offsetWidth;
            }
//记录Table宽度
//table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement;
//tTD.tableWidth = table.offsetWidth;
        };
        table1.rows[0].cells[j].onmouseup = function () {
//结束宽度调整
            if (tTD == undefined) tTD = this;
            tTD.mouseDown = false;
            tTD.style.cursor = 'default';
        };
        table.rows[0].cells[j].onmousemove = function () {
//更改鼠标样式
            if (event.offsetX > this.offsetWidth - 10)
                this.style.cursor = 'col-resize';
            else
                this.style.cursor = 'default';
//取出暂存的Table Cell
            if (tTD == undefined) tTD = this;
//调整宽度
            if (tTD.mouseDown != null && tTD.mouseDown == true) {
                tTD.style.cursor = 'default';
                if (tTD.oldWidth + (event.x - tTD.oldX) > 0)
                    tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
//调整列宽
                tTD.style.width = tTD.width;
                tTD.style.cursor = 'col-resize';
//调整该列中的每个Cell
                table1 = tTD;
                while (table1.tagName != 'TABLE') table1 = table1.parentElement;
                for (j = 0; j < table1.rows.length; j++) {
                    table1.rows[j].cells[tTD.cellIndex].width = tTD.width;
                }
//调整整个表
//table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth);
//table.style.width = table.width;
            }
        };
    }
</script>
</body>
</html>